package oop.ex4.crosswords;

import java.io.IOException;
import java.security.InvalidParameterException;

/**
 * A crossword shape represents rectangular form of crossword. <br>
 * Each cell in this form can be either FRAME_SLOT - the crossword background 
 * or UNUSED_SLOT for spaces. 
 * 
 * @author Dima
 * 
 */
public interface CrosswordShape {

	///////////////////////////////////////////////////////
	//////////////////////////Enum/////////////////////////
	///////////////////////////////////////////////////////

	/**
	 * The 2 available slots types: FRAME_SLOT for background and UNUSED_SLOT 
	 * for spaces.
	 */
	enum SlotType {
		FRAME_SLOT, UNUSED_SLOT
	};
	
	///////////////////////////////////////////////////////
	/////////////////////Public Methods////////////////////
	///////////////////////////////////////////////////////
	
	/**
	 * Loads and initializes the shape from a text file as sequence lines, each
	 * of which is a sequence of #'s and _'s. The file format described in
	 * exercise PDF.
	 * 
	 * @param textFileName The name of the text file.
	 * @throws IOException If there was failure to read the file.
	 */
	void load(String textFileName) throws IOException;

	/**
	 * Retrieves the slot type of specific entry.
	 * 
	 * @param x The x coordinate.
	 * @param y The y coordinate.
	 * @return The cell type.
	 * 
	 */
	SlotType getSlotType(CrosswordPosition pos) throws InvalidParameterException;

	/**
	 * Returns the number of columns in the crossword.
	 * @return The number of columns.
	 */
	Integer getWidth();

	/**
	 * Returns the number of rows in the crossword.
	 * @return The number of rows.
	 */
	Integer getHeight();
}
